<?php
echo 
StartForm("DiscontinueProduct","post","",array(''=>''),"","","frmDiscontineProduct");
if($strStyleSheet == TRUE){
	echo "<table class='Normal' border='0' align='left' width='100%' bgcolor='white'>";
}?>

     <tr align='left'  class='Normal'>
         <td align='left' colspan='5'>
             <H2>Product Search Result</H2>
         </td>
     </tr><?

//include (MODULE . "/screen/SearchProduct");
//include (MODULE . "/action/qrySelectProduct");
//echo $strSQL;
if(!$myrow[0]==""){
     do { 
	 	$strPicture = "";
		 if($myrow["UnitsInStock"] == 0)
			$strBackgroundImage = "background='./vendere-images/outofstock.jpg'";
		 else
		 	 $strBackgroundImage = "";
				  
		 if($myrow["Discontinued"] > "0")
			$strBackgroundImage = "background='./vendere-images/discontinued.jpg'";
		 //else 
		 	 //$strBackgroundImage = "";?>

     <tr bgcolor='<?=switch_background($boBG)?>'  class='Normal'>
         <td>
             <a href='<?=ScreenURL("EnterProduct",array('intProductID'=>$myrow[0]) )?>' target='_blank'>
             <img src='./images<?=SITE_SUFFIX?>/update.gif' border='0' alt='Update' align='middle'></a>
         </td>
		 <td  valign='top'><?
	
			if((!$myrow["UploadedPicture"])||($myrow["UploadedPicture"]=="none")){
				echo "no pic";
			}else{

				if(file_exists("./images/product/thumbz/".$myrow["UploadedPicture"]))
					$strPicture = "./images/product/thumbz/".$myrow["UploadedPicture"];
				elseif(file_exists("./images/product/thumbz/".$myrow["UploadedPicture"].".jpg"))
					$strPicture = "./images/product/thumbz/".$myrow["UploadedPicture"].".jpg";
						
				echo "<img src='".$strPicture."' width='67' border='0' alt='".$myrow["UploadedPicture"]."'>";
			}?>
		 
		</td>
		 <td  valign='top' class='Small' <?=$strBackgroundImage ?>><?echo "
			 <b><a href='" . ScreenURL("DisplayProductDetails_Popup",array('nProdID'=>$myrow[0],'nCategoryID'=>$myrow["CategoryID"]) ) . "' target='_blank'>".$myrow["Product"]."</a></b> <i>".DisplayLookupValue("tblCategory","Category",$myrow[Category])."</i><br/>
			 <b>SKU:</b> ".SITE.sprintf("%05d",$myrow["ID"]) ."<br/>
			 ".$myrow["Description"]."<br/>
			 <b>Supplier : </b>".DisplayLookupValue("tblSupplier","Supplier",$myrow[Supplier])." <b>Supplier Product No : </b>".$myrow[SupplierProductID]."&nbsp;<b>Our Price :</b> ".CURRENCY.$myrow["UnitPrice"]."<br/>
			 <b>META Title :</b> ".$myrow[MetaTitle]."<br/>
			 <b>META Description :</b> ".$myrow[MetaDescription]."<br/>
			 <b>META Keywords :</b> ".$myrow[MetaKeyword];
			 
					if($myrow["UnitsInStock"] < "1")
						echo "<br/><strong>Temporarily out of stock</strong><br/>";				
					
					if($myrow["Discontinued"] > "0")
						echo "<b>Discontinued</b><br/>";?>

			<br/><hr>
		 </td>
		 <td>
		 	<input name="arrProduct[<?=$myrow[0]?>]" type="checkbox">
		 </td>
         <td align='right' width='100'>
              <a href="<?=ScreenURL("SearchProduct",array('intProductID'=>$myrow[0],'ACTION'=>"qryDeleteProduct") )?>" onclick='return confirmLink(this, "Delete Product <?=$myrow[0]?>")'>
              <img src='./images<?=SITE_SUFFIX?>/delete.gif' border='0' alt='Delete' align='middle'></a>
         </td>    
     </tr>     <?


         $boBG = -1 - $boBG;
     } while ($myrow = mysql_fetch_array($result));?>
     <tr>
     	<td colspan='4'>
     		&nbsp;
     	</td>
     	<td>
     		<input type="submit" name="cmdDiscontinue" value="Discontinue"/>
     	</td>
     </tr><?
}else{
	echo "
     <tr class='MandatoryRed'><br/>
         <td colspan='3'>
             Your Search Has Returned No Results.
         </td>
     </tr>
	";
}

if($strStyleSheet == TRUE){
	echo "</table>";
}

?>
